function integrateData()
{
str = document.getElementById("csvData").value;

// there is something weird about the way that newlines are passed through
// POST, so replace the newlines with different special character.
// also, str.replace appears to be unreliable as well, which is why we're
// splitting manually
strArray = str.split("\n");
str = new String("");
for(i = 0; i < strArray.length; i++) {
    if(i == 0) {
        str = strArray[i];
    } else {
        str = str + "%n" + strArray[i];
    }
}

if (str.length==0)
  {
  document.getElementById("newCSV").innerHTML="";
  return;
  }
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("newCSV").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","processor.php?q="+str,true);
xmlhttp.send();
}